<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            /* 转化成行内块元素时，每部分之间会有空隙，所以为了解决这样的问题，可以使用浮动 */
           /* display: inline-block;  */
           

           /* 引入浮动 float:none/left/right*/
        float: left;
        }
        .box1 {
            background-color: red;
        }
        .box2 {
            background-color: blue;
        }
        .box3 {
            background-color: purple;
        }
    </style>
</head>
<body>
    <div class="box1">1</div>
    <div class="box2">2</div>
    <div class="box3">3</div>
</body>
</html>